<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script>
    'use strict';
    function abs(x){
        // 手动抛出异常
/*
        if(typeof x!=="number"){
            throw "not a number";
        }*/

        console.log("x-->" + x);
        for(var i = 0; i < arguments.length;i++){
            console.log(arguments[i]);
        }
      if(x>=0){
        return x;
      }else{
        return -x;
      }
    }


    var abs1 = function (x){
        if(x>=0){
            return x;
        }else{
            return -x;
        }
    }
  </script>
</head>
<body>

</body>
</html>